<template>
    <div class="sinOrder">
        <div class="top">
            <div class="shop_name">订单号：{{ orderData.order_id }}</div>
            <div class="order_state">{{ orderData.order_Status }}</div>
        </div>
        <div class="bottom">
            <div class="pic">
                <div class="pic_box" v-for="ele in orderData.goods_msg">
                    <img :src="ele.s_goods_photos[0].path" />
                </div>
            </div>
            <div class="msg">
                <div class="total">￥{{ orderData.total_price }}</div>
                <div class="num">共{{ orderData.total_num }}件</div>
            </div>
        </div>
        <div class="action">
            <van-button type="default" @click="deleteHandler(orderData)">删除订单</van-button>
        </div>
    </div>
</template>

<script setup>
defineProps({
    orderData: Object,
});
let emits = defineEmits(['goDel']);
const deleteHandler = item => {
    emits('goDel', item);
};
</script>

<style lang="scss" scoped>
@import '../../../style/base.scss';
.sinOrder {
    margin: 0 auto;
    padding: 0.16rem;
    width: 3.07rem;
    height: 0.98rem;
    background-color: #fff;
    border: 0.01rem solid #f1f1f1;
    border-radius: 0.1rem;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 0.03px 0.08px;
    .top {
        width: 100%;
        height: 0.22rem;
        line-height: 0.22rem;
        margin-bottom: 0.16rem;
        @include flexSet(space-between, center, none);
        .shop_name {
            width: 2.6rem;
            font-family: PingFangSC-Medium;
            font-size: 0.16rem;
            color: #333333;
        }
        .order_state {
            width: 0.42rem;
            font-family: PingFangSC-Medium;
            font-size: 0.14rem;
            color: #999999;
        }
    }
    .bottom {
        width: 100%;
        height: 0.4rem;
        @include flexSet(space-between, center, none);
        .pic {
            width: 2.08rem;
            height: 0.4rem;
            overflow: hidden;
            .pic_box {
                display: inline-block;
                width: 0.4rem;
                height: 0.4rem;
                padding-left: 0.12rem;
                overflow: hidden;
                img {
                    width: 100%;
                    height: auto;
                }
            }
        }
        .msg {
            height: 0.4rem;
            .total {
                width: 100%;
                height: 0.2rem;
                line-height: 0.2rem;
                font-family: PingFangSC-Regular;
                font-size: 0.14rem;
                color: #e93b3b;
                text-align: right;
            }
            .num {
                width: 100%;
                height: 0.2rem;
                line-height: 0.2rem;
                font-family: PingFangSC-Regular;
                font-size: 0.12rem;
                color: #333333;
                text-align: right;
            }
        }
    }
    .action {
        margin-top: 0.05rem;
        padding-top: 0.05rem;
        width: 100%;
        height: 0.2rem;
        border-top: 0.02rem solid #f1f1f1;

        @include flexSet(flex-end, center, none);
        button {
            height: 0.16rem;
            font-size: 0.12rem;
        }
    }
}
</style>
